package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysProcurementStaffMapper;
import com.ruoyi.system.domain.SysProcurementStaff;
import com.ruoyi.system.service.ISysProcurementStaffService;

/**
 * 采购员Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-29
 */
@Service
public class SysProcurementStaffServiceImpl implements ISysProcurementStaffService 
{
    @Autowired
    private SysProcurementStaffMapper sysProcurementStaffMapper;

    /**
     * 查询采购员
     * 
     * @param staffId 采购员主键
     * @return 采购员
     */
    @Override
    public SysProcurementStaff selectSysProcurementStaffByStaffId(Long staffId)
    {
        return sysProcurementStaffMapper.selectSysProcurementStaffByStaffId(staffId);
    }

    /**
     * 查询采购员列表
     * 
     * @param sysProcurementStaff 采购员
     * @return 采购员
     */
    @Override
    public List<SysProcurementStaff> selectSysProcurementStaffList(SysProcurementStaff sysProcurementStaff)
    {
        return sysProcurementStaffMapper.selectSysProcurementStaffList(sysProcurementStaff);
    }

    /**
     * 新增采购员
     * 
     * @param sysProcurementStaff 采购员
     * @return 结果
     */
    @Override
    public int insertSysProcurementStaff(SysProcurementStaff sysProcurementStaff)
    {
        sysProcurementStaff.setCreateTime(DateUtils.getNowDate());
        return sysProcurementStaffMapper.insertSysProcurementStaff(sysProcurementStaff);
    }

    /**
     * 修改采购员
     * 
     * @param sysProcurementStaff 采购员
     * @return 结果
     */
    @Override
    public int updateSysProcurementStaff(SysProcurementStaff sysProcurementStaff)
    {
        sysProcurementStaff.setUpdateTime(DateUtils.getNowDate());
        return sysProcurementStaffMapper.updateSysProcurementStaff(sysProcurementStaff);
    }

    /**
     * 批量删除采购员
     * 
     * @param staffIds 需要删除的采购员主键
     * @return 结果
     */
    @Override
    public int deleteSysProcurementStaffByStaffIds(Long[] staffIds)
    {
        return sysProcurementStaffMapper.deleteSysProcurementStaffByStaffIds(staffIds);
    }

    /**
     * 删除采购员信息
     * 
     * @param staffId 采购员主键
     * @return 结果
     */
    @Override
    public int deleteSysProcurementStaffByStaffId(Long staffId)
    {
        return sysProcurementStaffMapper.deleteSysProcurementStaffByStaffId(staffId);
    }
}
